package net.ak.service;

import java.util.List;

import net.ak.model.Category;
import net.ak.model.User;
import net.ak.model.UserCategory;

public interface UserService {
	/**
	 * This method is used to list all users
	 * @return
	 */
	List<User> listUsers();
	
	/**
	 * This method is used to get {@link User} by email
	 * @param email
	 * @return
	 */
	User getUserByEmail(String email);
	
	/**
	 * This method is used to save or update.
	 * @param user
	 * @return
	 */
	boolean saveOrUpdate(User user);
	
	/**
	 * This method is used to add category for user.
	 * @param user
	 * @param category
	 * @param description
	 * @param cost
	 * @return
	 */
	boolean addUserCategory(User user, Category category, String description, String cost);
	
	/**
	 * This method is used to get all {@link Category} by {@link User}
	 * @param user
	 * @return
	 */
	List<Category> listCategoriesByUser(User user);
	
	/**
	 * This method is used to find {@link Category} of {@link User}
	 * @param user
	 * @param category
	 * @return
	 */
	UserCategory findUserCategory(User user, Category category);
	
	/**
	 * This method is used to get {@link User} by email and password.
	 * @param email
	 * @param password
	 * @return
	 */
	User getUserByEmailAndPassword(String email, String password);
	
	/**
	 * This method is used to get all user by category.
	 * @param catId
	 * @return
	 */
	List<User> listUsersByCategory(Long catId);
}
